print(0.1 + 0.2) # 0.30000000000000004

print(0.1 + 0.2 == 0.3) # False

print((0.1 * 10 + 0.2 * 10) / 10) # 0.3

print((0.1 * 10 + 0.2 * 10) / 10 == 0.3) # True

import decimal
a = decimal.Decimal('0.1')
b = decimal.Decimal('0.2')
print(a + b) # 0.3

print(a + b == 0.3) # False
# 之所以为false是因为a和b是Decimal类型，而0.3是int
c = decimal.Decimal('0.3')
print(a + b == c) # True
# 这样就没问题了


